import request from '@/utils/request';
import store from "@/store";

const env = import.meta.env.MODE || 'development';
const prefix = '';

// 采购订单
// 订单状态数据
export function agentOrderOrderStatusDataApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/order/order_status_data`,
    method: 'get',
    params
  });
}

// 列表 /apiapp/v1/order/list
export function agentOrderListApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/order/list`,
    method: 'get',
    params
  });
}

// 详情 /apiapp/v1/order/details
export function agentOrderDetailsApi (id, params) {
  return request({
    url: `${prefix}/apiapp/v1/order/details?id=${id}`,
    method: 'get',
    params
  });
}

// 订单确认 /apiapp/v1/order/affirm
export function agentOrderConfirmApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/order/affirm?id=${id}`,
    method: 'post',
    data
  });
}

// 订单改地址 /apiapp/v1/order/address
export function agentOrderAddressApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/order/address?id=${id}`,
    method: 'post',
    data
  });
}

// 订单改价 /apiapp/v1/order/fee
export function agentOrderFeeApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/order/fee?id=${id}`,
    method: 'post',
    data
  });
}

// 订单改备注 /apiapp/v1/order/remark
export function agentOrderRemarkApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/order/remark?id=${id}`,
    method: 'post',
    data
  });
}

// 订单快递发货 /apiapp/v1/order/send_delivery
export function agentOrderSendApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/order/send_delivery?id=${id}`,
    method: 'post',
    data
  });
}

// 订单退款 /apiapp/v1/order/refund
export function agentOrderRefundApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/order/refund?id=${id}`,
    method: 'post',
    data
  });
}

// 租赁订单
// 订单状态数据 /apiapp/v1/rent_order/order_status_data
export function rentOrderStatusDataApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/rent_order/order_status_data`,
    method: 'get',
    params
  });
}

// 列表 /apiapp/v1/rent_order/list
export function rentOrderListApi (params) {
  return request({
    url: `${prefix}/apiapp/v1/rent_order/list`,
    method: 'get',
    params
  });
}

// 详情 /apiapp/v1/rent_order/details
export function rentOrderDetailsApi (id, params) {
  return request({
    url: `${prefix}/apiapp/v1/rent_order/details?id=${id}`,
    method: 'get',
    params
  });
}

// 直租发货 /apiapp/v1/rent_order/send_delivery
export function rentOrderSendDeliveryApi (id, data) {
  return request({
    url: `${prefix}/apiapp/v1/rent_order/send_delivery?id=${id}`,
    method: 'post',
    data
  });
}

// 仓库产品库存 /apiagent/v1/warehouse_product_stock/list
export function warehouseProductStockListApi (params) {
  return request({
    url: `${prefix}/apiagent/v1/warehouse_product_stock/list`,
    method: 'get',
    params
  });
}
